package Week5;


public class MainProg {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		
		System.out.println("Mike and Bo's Homework #5");
		System.out.println("=========================");
		
		//point
		Point p1 = new Point(2,2);
		System.out.println("");
		System.out.println("Point (x, y) coordinates: " + p1.toString());
		
		//circle
		Circle cr1 = new Circle(3);
		System.out.println("");
		System.out.println("Circle radius: " + cr1.getRad());		
		System.out.println("Dimension of circle: " + cr1.computeDimension());
		System.out.println("Perimeter of circle: " + cr1.computeLength());
		System.out.println("Area of circle: " + cr1.computeArea());
		
		//point buffer
		PointBuffer pb1 = new PointBuffer(p1,4);
		System.out.println("");
		System.out.println("Point buffer radius: " + pb1.getRad());
		System.out.println("Dimension of point buffer: " + pb1.computeDimension());
		System.out.println("Perimeter of point buffer: " + pb1.computeLength());
		System.out.println("Area of point buffer: " + pb1.computeArea());

		//check to see if a user generated point is inside the point buffer
		Point userPoint = new Point(4,3);
		System.out.println("");
		System.out.println("Is point " + userPoint + " inside point buffer? " + pb1.isInside(userPoint));
		
		//rectangle
		Rectangle rct1= new Rectangle(2,3);
		System.out.println("");
		System.out.println("Length of rectangle: " + rct1.side1);
		System.out.println("Width of rectangle: " + rct1.side2);
		System.out.println("Dimension of rectangle: " + rct1.computeDimension());
		System.out.println("Perimeter of rectangle: " + rct1.computeLength());
		System.out.println("Area of rectangle: " + rct1.computeArea());
		
		//square
		Square sq1 = new Square(4);
		System.out.println("");
		System.out.println("Length and width of square: " + sq1.side1);
		System.out.println("Dimension of square: " + sq1.computeDimension());
		System.out.println("Perimeter of square: " + sq1.computeLength());
		System.out.println("Area of square: " + sq1.computeArea());

		//polyline
		PolyLine pln1 = new PolyLine();
		pln1.add(new Point(2,2));
		pln1.add(new Point(2,4));
		pln1.add(new Point(3,4));
		pln1.add(new Point(3,2));
		System.out.println("");
		System.out.print("Polyline point coordinates: ");
		pln1.printAll();
		System.out.println("");
		System.out.println("Dimension of polyline: " + pln1.computeDimension());		
		System.out.println("Length of polyline: " + pln1.computeLength());
		System.out.println("Area of polyline: " + pln1.computeArea());

		//bounding box for polyline (pln1)
		BoundingBox bbPln1 = new BoundingBox (pln1.getPolypoints());
		System.out.println("");
		System.out.print("Bounding box upper-left and lower-right (x, y) coordinates for polyline: " + bbPln1.getBoundingBox());		
		System.out.println("");		

		//polygon
		Polygon plg1 = new Polygon();
		plg1.add(new Point(2,2));
		plg1.add(new Point(2,4));
		plg1.add(new Point(3,4));
		plg1.add(new Point(3,2));
		plg1.add(new Point(2,2));
		System.out.println("");
		System.out.print("Polygon point coordinates: ");
		plg1.printAll();
		System.out.println("");
		System.out.println("Is this set of points a polygon? " + plg1.isPolygon(plg1));		
		System.out.println("Dimension of polygon: " + plg1.computeDimension());		
		System.out.println("Length of polygon: " + plg1.computeLength(plg1));
		System.out.println("Area of polygon: (Polygon area method identified, but not implemented.)");
		
		//bounding box for polygon (plg1)
		BoundingBox bbPlg1 = new BoundingBox (plg1.getPolypoints());
		System.out.println("");
		System.out.print("Bounding box upper-left and lower-right (x, y) coordinates for polygon: " + bbPlg1.getBoundingBox());		
		System.out.println("");		
				
		//points intended for, but are not, a polygon
		Polygon plg2 = new Polygon();
		plg2.add(new Point(2,2));
		plg2.add(new Point(2,4));
		plg2.add(new Point(3,4));
		plg2.add(new Point(3,2));
		plg2.add(new Point(2,1));
		System.out.println("");
		System.out.println("Points intended for, but are not, a polygon ...");
		System.out.print("Polygon point coordinates: ");
		plg2.printAll();
		System.out.println("");
		System.out.println("Is this set of points a polygon? " + plg2.isPolygon(plg2));		
		System.out.println("Dimension of polygon: " + plg2.computeDimension());		
		System.out.println("Length of polygon: " + plg2.computeLength(plg2));
		System.out.println("Area of polygon: (Polygon area method identified, but not implemented.)");
		
		System.out.println("");			
		System.out.println("That's all folks!");
	}

}
